package com.ycg.vue.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 天气枚举类
 * @Author jink
 * @Date 2024/8/29
 */
@Getter
@AllArgsConstructor
public enum WeatherEnum {
    NEW_MOON("New Moon", "新月"),
    WAXING_GIBBOUS("Waxing Gibbous", "盈凸月"),
    FULL_MOON("Full Moon", "满月"),
    WANING_GIBBOUS("Waning Gibbous", "亏凸月"),
    WAXING_CRESCENT("Waxing Crescent", "峨眉月"),
    WANING_CRESCENT("Waning Crescent", "残月"),
    FIRST_QUARTER("First Quarter", "上弦月"),
    LAST_QUARTER("Last Quarter", "下弦月"),
    CLEAR("Clear", "晴"),
    SUNNY("Sunny", "晴"),
    PARTLY_CLOUDY("Partly Cloudy", "多云"),
    CLOUDY("Cloudy", "多云"),
    OVERCAST("Overcast", "阴"),
    MIST("Mist", "雾"),
    FOG("Fog", "雾"),
    FREEZING_FOG("Freezing Fog", "冻雾"),
    HAZE("Haze", "霾"),
    PATCHY_RAIN_POSSIBLE("Patchy Rain Possible", "小雨"),
    LIGHT_RAIN("Light Rain", "小雨"),
    MODERATE_RAIN("Moderate Rain", "中雨"),
    HEAVY_RAIN("Heavy Rain", "大雨"),
    TORRENTIAL_RAIN_SHOWER("Torrential Rain shower", "倾盆大雨"),
    PATCHY_LIGHT_DRIZZLE("Patchy Light Drizzle", "毛毛雨"),
    PATCHY_LIGHT_NEARBY("Patchy Rain Nearby", "附近有毛毛雨"),
    LIGHT_DRIZZLE("Light Drizzle", "毛毛雨"),
    PATCHY_LIGHT_RAIN("Patchy Light Rain", "小雨"),
    LIGHT_SNOW("Light Snow", "小雪"),
    PATCHY_SNOW_POSSIBLE("Patchy Snow Possible", "小雪"),
    MODERATE_SNOW("Moderate Snow", "中雪"),
    HEAVY_SNOW("Heavy Snow", "大雪"),
    BLIZZARD("Blizzard", "暴风雪"),
    PATCHY_FREEZING_DRIZZLE("Patchy Freezing Drizzle", "冻雨"),
    LIGHT_FREEZING_RAIN("Light Freezing Rain", "小冻雨"),
    HEAVY_FREEZING_RAIN("Heavy Freezing Rain", "大冻雨"),
    THUNDERY_OUTBREAKS_POSSIBLE("Thundery Outbreaks Possible", "雷阵雨"),
    PATCHY_LIGHT_RAIN_WITH_THUNDER("Patchy Light Rain With Thunder", "雷阵雨"),
    MODERATE_OR_HEAVY_RAIN_WITH_THUNDER("Moderate Or Heavy Rain With Thunder", "中到大雨伴有雷暴"),
    PATCHY_LIGHT_SNOW_WITH_THUNDER("Patchy Light Snow With Thunder", "雷阵雪"),
    MODERATE_OR_HEAVY_SNOW_WITH_THUNDER("Moderate Or Heavy Snow With Thunder", "中到大雪伴有雷暴"),
    LIGHT_RAIN_SHOWER("Light Rain Shower", "小阵雨"),
    MODERATE_OR_HEAVY_RAIN_SHOWER("Moderate Or Heavy Rain Shower", "中到大阵雨"),
    LIGHT_SNOW_SHOWER("Light Snow Shower", "小阵雪"),
    MODERATE_OR_HEAVY_SNOW_SHOWER("Moderate Or Heavy Snow Shower", "中到大阵雪"),
    FREEZING_DRIZZLE("Freezing Drizzle", "冻毛毛雨"),
    HEAVY_FREEZING_DRIZZLE("Heavy Freezing Drizzle", "强冻毛毛雨"),
    BLOWING_SNOW("Blowing Snow", "吹雪"),
    SANDSTORM("Sandstorm", "沙尘暴"),
    DUSTSTORM("Duststorm", "尘暴"),
    TORNADO("Tornado", "龙卷风"),
    HURRICANE("Hurricane", "飓风");

    private String englishName;
    private String chineseName;

    public static String getNameByType(String type) {
        return java.util.Arrays.stream(WeatherEnum.values())
                .filter(weather -> weather.getEnglishName().equalsIgnoreCase(type))
                .map(WeatherEnum::getChineseName)
                .findFirst()
                .orElse("");
    }
}
